<?php
namespace app\admin\model;
use \think\Db;
use \think\Model;

class Main extends Model{
	
	public function lists(){

		$lists = Db::table('zhaopin')
			->field('id,name,age,birthday,phone,school,job,major')
			->where('id','>',0)
			->paginate(10); //每页显示10条数据
		
		return $lists;
		
	}
	
	/*public function object2array($lists){
    	
    	foreach ($lists as $key => $value) {
      		$array[$key] = $value;
    	}
    	return $array;
    	
    }*/
	
	public function counts(){
		
		/*$counts = Db::table('zhaopin')
			->where('id','>',0)
			->count();
			
		return $counts;*/
	}
	
}
